Functions for analyzing and plotting data
aprioriPlotting <- function(target, targetTissue, targetLevel, ...) {
plot <-
lcpm.all %>%
filter(levelGT == targetLevel,
identifier == target,
tissue == targetTissue) %>%
mutate(SSgroup.virus.sac = fct_relevel(SSgroup.virus.sac, "CONTROL", "LOW", "MODERATE", "HIGH")) %>%
ggplot(aes(x = SSgroup.virus.sac, y = lcpm)) +
geom_boxplot() +
facet_grid(. ~ tmpID, scales = "free", space = "free") +
ylab("Log2(Counts per million)") +
xlab("SSgroup.virus.sac") +
theme_classic() +
labs(title=paste0(target),
subtitle=paste0(targetTissue, " - ", targetLevel))
print(plot)
}